<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>威客任务列表 - 高级筛选</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #165DFF;
            --primary-light: #E8F3FF;
            --success: #36D399;
            --warning: #FBBD23;
            --danger: #F87272;
            --dark: #1D2939;
            --light: #F9FAFB;
            --gray: #667085;
            --border: #E5E7EB;
            --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        }
        
        body {
            font-family: 'Inter', system-ui, -apple-system, sans-serif;
            background-color: var(--light);
            color: var(--dark);
            line-height: 1.6;
            padding-top: 20px;
            padding-bottom: 60px;
        }
        
        .container {
            max-width: 1200px;
        }
        
        .page-header {
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }
        
        .page-title {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }
        
        .page-description {
            color: var(--gray);
            font-size: 0.95rem;
        }
        
        /* 筛选区域样式 */
        .filter-container {
            background-color: white;
            border-radius: 10px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 2rem;
        }
        
        .filter-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }
        
        .filter-title {
            font-size: 1.1rem;
            font-weight: 600;
            display: flex;
            align-items: center;
        }
        
        .filter-title i {
            margin-right: 8px;
            color: var(--primary);
        }
        
        .filter-actions {
            display: flex;
            gap: 1rem;
        }
        
        .btn-reset {
            background-color: white;
            border: 1px solid var(--border);
            color: var(--gray);
            padding: 6px 16px;
            border-radius: 6px;
            font-size: 0.9rem;
            transition: all 0.2s;
        }
        
        .btn-reset:hover {
            background-color: var(--light);
        }
        
        .btn-apply {
            background-color: var(--primary);
            color: white;
            border: none;
            padding: 6px 16px;
            border-radius: 6px;
            font-size: 0.9rem;
            transition: all 0.2s;
        }
        
        .btn-apply:hover {
            background-color: #0E42D2;
        }
        
        .filter-row {
            display: flex;
            flex-wrap: wrap;
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }
        
        .filter-group {
            flex: 1;
            min-width: 200px;
        }
        
        .filter-label {
            display: block;
            margin-bottom: 0.75rem;
            font-weight: 500;
            color: var(--dark);
        }
        
        .form-select, .form-control {
            border-color: var(--border);
            border-radius: 6px;
            padding: 8px 12px;
            font-size: 0.95rem;
            width: 100%;
        }
        
        .form-select:focus, .form-control:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
            outline: none;
        }
        
        /* 高级筛选区域 */
        .advanced-filters {
            margin-top: 1rem;
            border-top: 1px dashed var(--border);
            padding-top: 1.5rem;
        }
        
        .advanced-toggle {
            background: none;
            border: none;
            color: var(--primary);
            font-size: 0.95rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            margin-bottom: 1rem;
        }
        
        .advanced-toggle i {
            margin-right: 5px;
            transition: transform 0.3s;
        }
        
        .advanced-toggle.collapsed i {
            transform: rotate(-180deg);
        }
        
        .checkbox-group {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 1rem;
        }
        
        .form-check {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .form-check-input {
            border-color: var(--border);
        }
        
        .form-check-input:checked {
            background-color: var(--primary);
            border-color: var(--primary);
        }
        
        .range-slider {
            width: 100%;
            margin: 1rem 0;
        }
        
        .range-values {
            display: flex;
            justify-content: space-between;
            font-size: 0.9rem;
            color: var(--gray);
        }
        
        /* 快速筛选标签 */
        .quick-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 2rem;
        }
        
        .quick-filter {
            background-color: white;
            border: 1px solid var(--border);
            color: var(--dark);
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        
        .quick-filter:hover, .quick-filter.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 结果统计 */
        .results-stats {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }
        
        .stats-text {
            color: var(--gray);
            font-size: 0.95rem;
        }
        
        .stats-text strong {
            color: var(--dark);
        }
        
        .view-options {
            display: flex;
            gap: 0.5rem;
        }
        
        .view-btn {
            background-color: white;
            border: 1px solid var(--border);
            color: var(--gray);
            width: 36px;
            height: 36px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .view-btn:hover, .view-btn.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 任务卡片样式 */
        .task-list {
            margin-bottom: 2rem;
        }
        
        .task-card {
            background-color: white;
            border-radius: 10px;
            box-shadow: var(--shadow);
            overflow: hidden;
            transition: transform 0.2s, box-shadow 0.2s;
            margin-bottom: 1.25rem;
        }
        
        .task-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        }
        
        .task-body {
            padding: 1.25rem;
            display: flex;
            flex-direction: row;
        }
        
        .task-media {
            flex: 0 0 180px;
            height: 140px;
            margin-right: 1.25rem;
            border-radius: 8px;
            overflow: hidden;
            position: relative;
        }
        
        .task-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .no-image {
            width: 100%;
            height: 100%;
            background-color: var(--primary-light);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            font-size: 1.5rem;
        }
        
        .image-count {
            position: absolute;
            top: 8px;
            right: 8px;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            font-size: 0.8rem;
            padding: 2px 6px;
            border-radius: 10px;
        }
        
        .task-content {
            flex: 1;
        }
        
        .task-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.75rem;
        }
        
        .task-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--dark);
            transition: color 0.2s;
            margin: 0;
        }
        
        .task-card:hover .task-title {
            color: var(--primary);
        }
        
        .price-tag {
            background-color: var(--success);
            color: white;
            padding: 3px 10px;
            border-radius: 4px;
            font-weight: 600;
            font-size: 0.9rem;
            white-space: nowrap;
        }
        
        .task-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 1.25rem;
            margin-bottom: 0.75rem;
            color: var(--gray);
            font-size: 0.9rem;
        }
        
        .meta-item {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .task-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 0.75rem;
        }
        
        .task-tag {
            background-color: var(--light);
            color: var(--gray);
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 0.85rem;
        }
        
        .task-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .task-author {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .author-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .author-name {
            font-size: 0.9rem;
            color: var(--dark);
            font-weight: 500;
        }
        
        .task-actions {
            display: flex;
            gap: 1rem;
        }
        
        .action-btn {
            background: none;
            border: none;
            color: var(--gray);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 5px;
            transition: color 0.2s;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.9rem;
        }
        
        .action-btn:hover {
            color: var(--primary);
            background-color: var(--primary-light);
        }
        
        .action-btn.liked {
            color: var(--danger);
        }
        
        .action-btn.bookmarked {
            color: var(--warning);
        }
        
        /* 网格布局 */
        .grid-view .task-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
        }
        
        .grid-view .task-body {
            flex-direction: column;
        }
        
        .grid-view .task-media {
            flex: none;
            width: 100%;
            height: 160px;
            margin-right: 0;
            margin-bottom: 1rem;
        }
        
        .grid-view .task-footer {
            flex-direction: column;
            align-items: flex-start;
            gap: 0.75rem;
            margin-top: 1rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border);
        }
        
        /* 紧凑布局 */
        .compact-view .task-body {
            padding: 1rem;
            align-items: center;
        }
        
        .compact-view .task-media {
            flex: 0 0 80px;
            height: 80px;
        }
        
        .compact-view .task-tags,
        .compact-view .task-description {
            display: none;
        }
        
        .compact-view .task-footer {
            flex-direction: row;
        }
        
        /* 分页样式 */
        .pagination-container {
            display: flex;
            justify-content: center;
            margin-top: 2rem;
        }
        
        .pagination {
            display: flex;
            gap: 0.5rem;
        }
        
        .page-item {
            list-style: none;
        }
        
        .page-link {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 6px;
            border: 1px solid var(--border);
            background-color: white;
            color: var(--dark);
            text-decoration: none;
            transition: all 0.2s;
        }
        
        .page-link:hover {
            background-color: var(--primary-light);
            color: var(--primary);
        }
        
        .page-item.active .page-link {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        .page-item.disabled .page-link {
            color: var(--gray);
            pointer-events: none;
            background-color: var(--light);
        }
        
        /* 响应式调整 */
        @media (max-width: 768px) {
            .task-body {
                flex-direction: column;
            }
            
            .task-media {
                flex: none;
                width: 100%;
                height: 160px;
                margin-right: 0;
                margin-bottom: 1rem;
            }
            
            .filter-row {
                gap: 1rem;
            }
            
            .filter-group {
                min-width: 100%;
            }
            
            .quick-filters {
                gap: 0.5rem;
            }
            
            .quick-filter {
                padding: 4px 10px;
                font-size: 0.85rem;
            }
            
            .task-footer {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 页面标题 -->
        <div class="page-header">
            <h1 class="page-title">威客任务列表</h1>
            <p class="page-description">通过多种筛选条件，快速找到适合您的任务</p>
        </div>
        
        <!-- 筛选区域 -->
        <div class="filter-container">
            <div class="filter-header">
                <h2 class="filter-title">
                    <i class="fas fa-filter"></i> 任务筛选
                </h2>
                <div class="filter-actions">
                    <button class="btn-reset" id="resetFilters">
                        <i class="fas fa-sync-alt"></i> 重置
                    </button>
                    <button class="btn-apply" id="applyFilters">
                        <i class="fas fa-check"></i> 应用筛选
                    </button>
                </div>
            </div>
            
            <div class="filter-content">
                <div class="filter-row">
                    <div class="filter-group">
                        <label class="filter-label">任务分类</label>
                        <select class="form-select" id="categoryFilter">
                            <option value="">全部分类</option>
                            <option value="design">设计类</option>
                            <option value="development">开发类</option>
                            <option value="writing">写作类</option>
                            <option value="marketing">营销类</option>
                            <option value="video">视频/音频</option>
                            <option value="data">数据处理</option>
                            <option value="translation">翻译类</option>
                            <option value="other">其他</option>
                        </select>
                    </div>
                    
                    <div class="filter-group">
                        <label class="filter-label">价格范围</label>
                        <select class="form-select" id="priceFilter">
                            <option value="">全部价格</option>
                            <option value="0-100">￥0 - ￥100</option>
                            <option value="100-500">￥100 - ￥500</option>
                            <option value="500-1000">￥500 - ￥1000</option>
                            <option value="1000-3000">￥1000 - ￥3000</option>
                            <option value="3000-5000">￥3000 - ￥5000</option>
                            <option value="5000+">￥5000以上</option>
                        </select>
                    </div>
                    
                    <div class="filter-group">
                        <label class="filter-label">任务状态</label>
                        <select class="form-select" id="statusFilter">
                            <option value="">全部状态</option>
                            <option value="open">可接取</option>
                            <option value="in-progress">进行中</option>
                            <option value="completed">已完成</option>
                        </select>
                    </div>
                    
                    <div class="filter-group">
                        <label class="filter-label">发布时间</label>
                        <select class="form-select" id="timeFilter">
                            <option value="">不限时间</option>
                            <option value="today">今天</option>
                            <option value="week">本周</option>
                            <option value="month">本月</option>
                            <option value="quarter">近三个月</option>
                        </select>
                    </div>
                </div>
                
                <div class="filter-row">
                    <div class="filter-group">
                        <label class="filter-label">关键词搜索</label>
                        <input type="text" class="form-control" id="keywordFilter" placeholder="输入任务关键词...">
                    </div>
                    
                    <div class="filter-group">
                        <label class="filter-label">排序方式</label>
                        <select class="form-select" id="sortFilter">
                            <option value="recommend">推荐排序</option>
                            <option value="newest">最新发布</option>
                            <option value="price-asc">价格从低到高</option>
                            <option value="price-desc">价格从高到低</option>
                            <option value="popular">热门优先</option>
                        </select>
                    </div>
                    
                    <div class="filter-group">
                        <label class="filter-label">任务难度</label>
                        <select class="form-select" id="difficultyFilter">
                            <option value="">全部难度</option>
                            <option value="easy">简单</option>
                            <option value="medium">中等</option>
                            <option value="hard">困难</option>
                        </select>
                    </div>
                </div>
                
                <!-- 高级筛选 -->
                <button class="advanced-toggle" id="advancedToggle">
                    <i class="fas fa-chevron-down"></i> 高级筛选选项
                </button>
                
                <div class="advanced-filters" id="advancedFilters">
                    <div class="filter-row">
                        <div class="filter-group">
                            <label class="filter-label">是否需要保证金</label>
                            <div class="checkbox-group">
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="depositYes">
                                    <label class="form-check-label" for="depositYes">
                                        是
                                    </label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="depositNo">
                                    <label class="form-check-label" for="depositNo">
                                        否
                                    </label>
                                </div>
                            </div>
                        </div>
                        
                        <div class="filter-group">
                            <label class="filter-label">任务周期</label>
                            <select class="form-select" id="durationFilter">
                                <option value="">不限周期</option>
                                <option value="1-3">1-3天</option>
                                <option value="4-7">4-7天</option>
                                <option value="8-15">8-15天</option>
                                <option value="16-30">16-30天</option>
                                <option value="30+">30天以上</option>
                            </select>
                        </div>
                    </div>
                    
                    <div class="filter-row">
                        <div class="filter-group">
                            <label class="filter-label">服务模式</label>
                            <div class="checkbox-group">
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="serviceFixed">
                                    <label class="form-check-label" for="serviceFixed">
                                        固定价格
                                    </label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="serviceNegotiable">
                                    <label class="form-check-label" for="serviceNegotiable">
                                        可议价
                                    </label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="serviceHourly">
                                    <label class="form-check-label" for="serviceHourly">
                                        按小时计费
                                    </label>
                                </div>
                            </div>
                        </div>
                        
                        <div class="filter-group">
                            <label class="filter-label">雇主类型</label>
                            <div class="checkbox-group">
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="employerPerson">
                                    <label class="form-check-label" for="employerPerson">
                                        个人雇主
                                    </label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="employerCompany">
                                    <label class="form-check-label" for="employerCompany">
                                        企业雇主
                                    </label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="employerVerified">
                                    <label class="form-check-label" for="employerVerified">
                                        已认证雇主
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="filter-row">
                        <div class="filter-group">
                            <label class="filter-label">浏览量范围</label>
                            <input type="range" class="range-slider" id="viewRange" min="0" max="1000" step="50" value="500">
                            <div class="range-values">
                                <span>0</span>
                                <span id="viewRangeValue">500+</span>
                                <span>1000+</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 快速筛选标签 -->
        <div class="quick-filters">
            <div class="quick-filter active">
                <i class="fas fa-th-large"></i> 全部任务
            </div>
            <div class="quick-filter">
                <i class="fas fa-bolt"></i> 紧急任务
            </div>
            <div class="quick-filter">
                <i class="fas fa-certificate"></i> 优质任务
            </div>
            <div class="quick-filter">
                <i class="fas fa-trophy"></i> 高额任务
            </div>
            <div class="quick-filter">
                <i class="fas fa-clock"></i> 新发布
            </div>
            <div class="quick-filter">
                <i class="fas fa-hand-holding-usd"></i> 有保证金
            </div>
        </div>
        
        <!-- 结果统计和视图切换 -->
        <div class="results-stats">
            <div class="stats-text">
                找到 <strong>128</strong> 个符合条件的任务
            </div>
            <div class="view-options">
                <button class="view-btn active" id="listViewBtn" title="列表视图">
                    <i class="fas fa-list"></i>
                </button>
                <button class="view-btn" id="gridViewBtn" title="网格视图">
                    <i class="fas fa-th"></i>
                </button>
                <button class="view-btn" id="compactViewBtn" title="紧凑视图">
                    <i class="fas fa-th-list"></i>
                </button>
            </div>
        </div>
        
        <!-- 任务列表 -->
        <div class="task-list-container">
            <div class="task-list" id="taskList">
                <!-- 任务1：多图 -->
                <div class="task-card" data-category="design" data-price="800" data-status="open">
                    <div class="task-body">
                        <div class="task-media">
                            <img src="https://picsum.photos/400/300?random=1" alt="网站UI设计任务预览" class="task-image">
                            <div class="image-count">3图</div>
                        </div>
                        <div class="task-content">
                            <div class="task-header">
                                <h3 class="task-title">企业官网UI设计，需要现代简约风格</h3>
                                <span class="price-tag">￥800</span>
                            </div>
                            <div class="task-meta">
                                <div class="meta-item">
                                    <i class="far fa-eye"></i>
                                    <span>245</span>
                                </div>
                                <div class="meta-item">
                                    <i class="far fa-comment"></i>
                                    <span>32</span>
                                </div>
                                <div class="meta-item">
                                    <i class="far fa-clock"></i>
                                    <span>3天前发布</span>
                                </div>
                                <div class="meta-item">
                                    <i class="fas fa-signal"></i>
                                    <span>中等难度</span>
                                </div>
                            </div>
                            <div class="task-tags">
                                <span class="task-tag">UI设计</span>
                                <span class="task-tag">网站</span>
                                <span class="task-tag">现代风格</span>
                            </div>
                            <div class="task-footer">
                                <div class="task-author">
                                    <img src="https://picsum.photos/100/100?random=101" alt="张先生的头像" class="author-avatar">
                                    <span class="author-name">张先生</span>
                                </div>
                                <div class="task-actions">
                                    <button class="action-btn">
                                        <i class="far fa-heart"></i>
                                        <span>42</span>
                                    </button>
                                    <button class="action-btn">
                                        <i class="far fa-bookmark"></i>
                                        <span>18</span>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 任务2：无图 -->
                <div class="task-card" data-category="writing" data-price="300" data-status="open">
                    <div class="task-body">
                        <div class="task-media">
                            <div class="no-image">
                                <i class="fas fa-file-alt"></i>
                            </div>
                        </div>
                        <div class="task-content">
                            <div class="task-header">
                                <h3 class="task-title">撰写一篇关于人工智能发展趋势的文章</h3>
                                <span class="price-tag">￥300</span>
                            </div>
                            <div class="task-meta">
                                <div class="meta-item">
                                    <i class="far fa-eye"></i>
                                    <span>187</span>
                                </div>
                                <div class="meta-item">
                                    <i class="far fa-comment"></i>
                                    <span>15</span>
                                </div>
                                <div class="meta-item">
                                    <i class="far fa-clock"></i>
                                    <span>1天前发布</span>
                                </div>
                                <div class="meta-item">
                                    <i class="fas fa-signal"></i>
                                    <span>简单</span>
                                </div>
                            </div>
                            <div class="task-tags">
                                <span class="task-tag">文案写作</span>
                                <span class="task-tag">人工智能</span>
                                <span class="task-tag">科技</span>
                            </div>
                            <div class="task-footer">
                                <div class="task-author">
                                    <img src="https://picsum.photos/100/100?random=102" alt="李编辑的头像" class="author-avatar">
                                    <span class="author-name">李编辑</span>
                                </div>
                                <div class="task-actions">
                                    <button class="action-btn liked">
                                        <i class="fas fa-heart"></i>
                                        <span>27</span>
                                    </button>
                                    <button class="action-btn">
                                        <i class="far fa-bookmark"></i>
                                        <span>9</span>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 任务3：单图 -->
                <div class="task-card" data-category="development" data-price="5000" data-status="open">
                    <div class="task-body">
                        <div class="task-media">
                            <img src="https://picsum.photos/400/300?random=3" alt="移动应用开发任务预览" class="task-image">
                        </div>
                        <div class="task-content">
                            <div class="task-header">
                                <h3 class="task-title">健身记录APP开发，需要iOS和Android版本</h3>
                                <span class="price-tag">￥5000</span>
                            </div>
                            <div class="task-meta">
                                <div class="meta-item">
                                    <i class="far fa-eye"></i>
                                    <span>562</span>
                                </div>
                                <div class="meta-item">
                                    <i class="far fa-comment"></i>
                                    <span>78</span>
                                </div>
                                <div class="meta-item">
                                    <i class="far fa-clock"></i>
                                    <span>5天前发布</span>
                                </div>
                                <div class="meta-item">
                                    <i class="fas fa-signal"></i>
                                    <span>困难</span>
                                </div>
                            </div>
                            <div class="task-tags">
                                <span class="task-tag">移动开发</span>
                                <span class="task-tag">健身</span>
                                <span class="task-tag">iOS</span>
                                <span class="task-tag">Android</span>
                            </div>
                            <div class="task-footer">
                                <div class="task-author">
                                    <img src="https://picsum.photos/100/100?random=103" alt="王经理的头像" class="author-avatar">
                                    <span class="author-name">王经理</span>
                                </div>
                                <div class="task-actions">
                                    <button class="action-btn">
                                        <i class="far fa-heart"></i>
                                        <span>124</span>
                                    </button>
                                    <button class="action-btn bookmarked">
                                        <i class="fas fa-bookmark"></i>
                                        <span>56</span>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 任务4：单图 -->
                <div class="task-card" data-category="marketing" data-price="1500" data-status="in-progress">
                    <div class="task-body">
                        <div class="task-media">
                            <img src="https://picsum.photos/400/300?random=6" alt="社交媒体营销任务预览" class="task-image">
                        </div>
                        <div class="task-content">
                            <div class="task-header">
                                <h3 class="task-title">社交媒体营销推广，增加品牌曝光</h3>
                                <span class="price-tag">￥1500</span>
                            </div>
                            <div class="task-meta">
                                <div class="meta-item">
                                    <i class="far fa-eye"></i>
                                    <span>342</span>
                                </div>
                                <div class="meta-item">
                                    <i class="far fa-comment"></i>
                                    <span>56</span>
                                </div>
                                <div class="meta-item">
                                    <i class="far fa-clock"></i>
                                    <span>2天前发布</span>
                                </div>
                                <div class="meta-item">
                                    <i class="fas fa-signal"></i>
                                    <span>中等难度</span>
                                </div>
                            </div>
                            <div class="task-tags">
                                <span class="task-tag">营销</span>
                                <span class="task-tag">社交媒体</span>
                                <span class="task-tag">品牌推广</span>
                            </div>
                            <div class="task-footer">
                                <div class="task-author">
                                    <img src="https://picsum.photos/100/100?random=107" alt="孙总监的头像" class="author-avatar">
                                    <span class="author-name">孙总监</span>
                                </div>
                                <div class="task-actions">
                                    <button class="action-btn">
                                        <i class="far fa-heart"></i>
                                        <span>89</span>
                                    </button>
                                    <button class="action-btn">
                                        <i class="far fa-bookmark"></i>
                                        <span>32</span>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 分页 -->
        <div class="pagination-container">
            <ul class="pagination">
                <li class="page-item disabled">
                    <a class="page-link" href="#" aria-label="Previous">
                        <i class="fas fa-chevron-left"></i>
                    </a>
                </li>
                <li class="page-item active"><a class="page-link" href="#">1</a></li>
                <li class="page-item"><a class="page-link" href="#">2</a></li>
                <li class="page-item"><a class="page-link" href="#">3</a></li>
                <li class="page-item"><a class="page-link" href="#">4</a></li>
                <li class="page-item"><a class="page-link" href="#">5</a></li>
                <li class="page-item">
                    <a class="page-link" href="#" aria-label="Next">
                        <i class="fas fa-chevron-right"></i>
                    </a>
                </li>
            </ul>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // 高级筛选切换
        const advancedToggle = document.getElementById('advancedToggle');
        const advancedFilters = document.getElementById('advancedFilters');
        
        advancedToggle.addEventListener('click', function() {
            advancedFilters.classList.toggle('d-none');
            this.classList.toggle('collapsed');
        });
        
        // 初始化隐藏高级筛选
        advancedFilters.classList.add('d-none');
        
        // 浏览量范围滑块
        const viewRange = document.getElementById('viewRange');
        const viewRangeValue = document.getElementById('viewRangeValue');
        
        viewRange.addEventListener('input', function() {
            viewRangeValue.textContent = this.value + '+';
        });
        
        // 视图切换
        const listViewBtn = document.getElementById('listViewBtn');
        const gridViewBtn = document.getElementById('gridViewBtn');
        const compactViewBtn = document.getElementById('compactViewBtn');
        const taskListContainer = document.querySelector('.task-list-container');
        
        listViewBtn.addEventListener('click', function() {
            taskListContainer.classList.remove('grid-view', 'compact-view');
            setActiveViewBtn(this);
        });
        
        gridViewBtn.addEventListener('click', function() {
            taskListContainer.classList.add('grid-view');
            taskListContainer.classList.remove('compact-view');
            setActiveViewBtn(this);
        });
        
        compactViewBtn.addEventListener('click', function() {
            taskListContainer.classList.remove('grid-view');
            taskListContainer.classList.add('compact-view');
            setActiveViewBtn(this);
        });
        
        function setActiveViewBtn(activeBtn) {
            [listViewBtn, gridViewBtn, compactViewBtn].forEach(btn => {
                btn.classList.remove('active');
            });
            activeBtn.classList.add('active');
        }
        
        // 快速筛选标签
        document.querySelectorAll('.quick-filter').forEach(filter => {
            filter.addEventListener('click', function() {
                document.querySelectorAll('.quick-filter').forEach(f => {
                    f.classList.remove('active');
                });
                this.classList.add('active');
                
                // 模拟筛选动作
                applyFilters();
            });
        });
        
        // 点赞和收藏功能
        document.querySelectorAll('.action-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const icon = this.querySelector('i');
                const countElem = this.querySelector('span');
                
                if (icon.classList.contains('fa-heart')) {
                    // 点赞功能
                    if (icon.classList.contains('far')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        this.classList.add('liked');
                        if (countElem) {
                            countElem.textContent = parseInt(countElem.textContent) + 1;
                        }
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        this.classList.remove('liked');
                        if (countElem) {
                            countElem.textContent = parseInt(countElem.textContent) - 1;
                        }
                    }
                } else if (icon.classList.contains('fa-bookmark')) {
                    // 收藏功能
                    if (icon.classList.contains('far')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        this.classList.add('bookmarked');
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        this.classList.remove('bookmarked');
                    }
                }
            });
        });
        
        // 筛选功能
        document.getElementById('applyFilters').addEventListener('click', applyFilters);
        document.getElementById('resetFilters').addEventListener('click', resetFilters);
        
        function applyFilters() {
            // 获取所有筛选条件
            const category = document.getElementById('categoryFilter').value;
            const priceRange = document.getElementById('priceFilter').value;
            const status = document.getElementById('statusFilter').value;
            const time = document.getElementById('timeFilter').value;
            const keyword = document.getElementById('keywordFilter').value.toLowerCase();
            const difficulty = document.getElementById('difficultyFilter').value;
            
            // 高级筛选条件
            const depositYes = document.getElementById('depositYes').checked;
            const depositNo = document.getElementById('depositNo').checked;
            const duration = document.getElementById('durationFilter').value;
            const viewCount = parseInt(document.getElementById('viewRange').value);
            
            // 服务模式筛选
            const serviceFixed = document.getElementById('serviceFixed').checked;
            const serviceNegotiable = document.getElementById('serviceNegotiable').checked;
            const serviceHourly = document.getElementById('serviceHourly').checked;
            
            // 雇主类型筛选
            const employerPerson = document.getElementById('employerPerson').checked;
            const employerCompany = document.getElementById('employerCompany').checked;
            const employerVerified = document.getElementById('employerVerified').checked;
            
            let visibleCount = 0;
            
            // 筛选任务卡片
            document.querySelectorAll('.task-card').forEach(card => {
                let isVisible = true;
                
                // 分类筛选
                if (category && card.dataset.category !== category) {
                    isVisible = false;
                }
                
                // 价格筛选
                if (priceRange && isVisible) {
                    const price = parseInt(card.dataset.price);
                    const [min, max] = priceRange.split('-');
                    
                    if (max === '+') {
                        if (price < parseInt(min)) {
                            isVisible = false;
                        }
                    } else if (!(price >= parseInt(min) && price <= parseInt(max))) {
                        isVisible = false;
                    }
                }
                
                // 状态筛选
                if (status && card.dataset.status !== status) {
                    isVisible = false;
                }
                
                // 关键词筛选
                if (keyword && isVisible && 
                    !card.querySelector('.task-title').textContent.toLowerCase().includes(keyword) &&
                    !Array.from(card.querySelectorAll('.task-tag')).some(tag => 
                        tag.textContent.toLowerCase().includes(keyword)
                    )) {
                    isVisible = false;
                }
                
                // 这里可以继续添加其他筛选条件的逻辑
                
                // 显示或隐藏任务卡片
                if (isVisible) {
                    card.style.display = '';
                    visibleCount++;
                } else {
                    card.style.display = 'none';
                }
            });
            
            // 更新结果统计
            document.querySelector('.stats-text strong').textContent = visibleCount;
            
            // 显示筛选反馈
            showFilterFeedback();
        }
        
        function resetFilters() {
            // 重置所有筛选条件
            document.getElementById('categoryFilter').value = '';
            document.getElementById('priceFilter').value = '';
            document.getElementById('statusFilter').value = '';
            document.getElementById('timeFilter').value = '';
            document.getElementById('keywordFilter').value = '';
            document.getElementById('sortFilter').value = 'recommend';
            document.getElementById('difficultyFilter').value = '';
            document.getElementById('durationFilter').value = '';
            document.getElementById('viewRange').value = 500;
            document.getElementById('viewRangeValue').textContent = '500+';
            
            // 重置复选框
            document.querySelectorAll('input[type="checkbox"]').forEach(checkbox => {
                checkbox.checked = false;
            });
            
            // 重置快速筛选
            document.querySelectorAll('.quick-filter').forEach((filter, index) => {
                filter.classList.toggle('active', index === 0);
            });
            
            // 显示所有任务
            document.querySelectorAll('.task-card').forEach(card => {
                card.style.display = '';
            });
            
            // 更新结果统计
            document.querySelector('.stats-text strong').textContent = 
                document.querySelectorAll('.task-card').length;
        }
        
        function showFilterFeedback() {
            // 创建筛选反馈元素（如果不存在）
            let feedback = document.getElementById('filterFeedback');
            if (!feedback) {
                feedback = document.createElement('div');
                feedback.id = 'filterFeedback';
                feedback.className = 'alert alert-info alert-dismissible fade show mt-3';
                feedback.role = 'alert';
                feedback.innerHTML = `
                    <strong>筛选已应用</strong> 
                    <span id="feedbackText"></span>
                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                `;
                document.querySelector('.filter-container').insertAdjacentElement('afterend', feedback);
            }
            
            // 更新反馈文本
            const activeFilters = [];
            if (document.getElementById('categoryFilter').value) {
                activeFilters.push('分类: ' + 
                    document.getElementById('categoryFilter').options[
                        document.getElementById('categoryFilter').selectedIndex
                    ].text);
            }
            if (document.getElementById('priceFilter').value) {
                activeFilters.push('价格: ' + 
                    document.getElementById('priceFilter').options[
                        document.getElementById('priceFilter').selectedIndex
                    ].text);
            }
            if (document.getElementById('keywordFilter').value) {
                activeFilters.push('关键词: ' + document.getElementById('keywordFilter').value);
            }
            
            // 显示反馈信息
            if (activeFilters.length > 0) {
                document.getElementById('feedbackText').textContent = 
                    '已应用 ' + activeFilters.length + ' 个筛选条件: ' + activeFilters.join('，');
                feedback.classList.remove('d-none');
            } else {
                feedback.classList.add('d-none');
            }
            
            // 3秒后自动隐藏反馈
            setTimeout(() => {
                const bsAlert = bootstrap.Alert.getInstance(feedback);
                if (bsAlert) bsAlert.close();
            }, 3000);
        }
    </script>
</body>
</html>
    
